Oil Spill Spatial Data Visualization

Summary

These maps show the oil spills in California in 2008. The first map is an interactive map showing all of the oil spill incidents in 2008. The second map shows the counts of inland oil spills in California in 2008.

Show code
# read in the data
oil_spill <- read_sf(here("data_3", "oil_spill", "ds394.shp")) %>% 
  clean_names()

ca_counties <- read_sf(here("data_3", "county"), layer = "CA_Counties_TIGER2016") %>% 
  clean_names() %>% 
  select(name)

ca_counties <- st_transform(ca_counties, st_crs(oil_spill))

Interactive Oil Spill Events Locations

Show code
tmap_mode("view")

tm_shape(oil_spill) +
  tm_dots()

Map of Inland Oil Spills by County

Show code
# finding the counts
oil_spill_inland <- oil_spill %>% 
  filter(inlandmari == "Inland") %>% 
  rename("name" = "localecoun")

# joining the data
oil_county <- ca_counties %>% 
  st_join(oil_spill_inland)

# find counts
spill_counts <- oil_county %>% 
  count(name.x)

# plotting the data
ggplot(data = spill_counts) +
  geom_sf(aes(fill = n),
          color = "white",
          size = 0.1) +
  scale_fill_gradientn(colors = c("lightgray", "yellow1", "yellow2", "orange1", "orange2", "red")) +
  theme_minimal() +
  labs(fill = "Number of Inland Oil Spills",
       title = "Number of Inland Oil Spills by California County, 2008",
       x = "Longitude",
       y = "Latitude")
Inland oil spill counts by California county in 2008. Data from: Oil Spill Incident Tracking. 2009-07-23. California Department of Fish and Game, Office of Spill Prevention and Response. https://map.dfg.ca.gov/metadata/ds0394.html

Figure 1: Inland oil spill counts by California county in 2008. Data from: Oil Spill Incident Tracking. 2009-07-23. California Department of Fish and Game, Office of Spill Prevention and Response. https://map.dfg.ca.gov/metadata/ds0394.html